# @time     :2022/2/19
# @Author   :Simple
# @FileName :report
import os
import time

from util.logger import log as logger
from util.config import REPORT_DIR


def init_report(file_name):

    """
    初始化测试报告目录
    """
    now_time = time.strftime("%Y_%m_%d_%H_%M_%S")
    report_name = now_time + "-" + file_name.replace(" ", "")
    report = os.path.join(REPORT_DIR, report_name)
    logger.info(f"report dir {report_name}")
    os.mkdir(report)
    os.mkdir(os.path.join(report, "image"))
    return report
